package com.zhang.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;

/**
 * 用户实体类
 */
@Data
@NoArgsConstructor
public class UserBean {
    /**用户编号*/
    private int userId;
    /**用户名*/
    private String username;
    /**用户密码*/
    private String pwd ;
    /**用户邮箱*/
    private String email;
    /**注册时间*/
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate time = LocalDate.now();
    /**用户头像*/
    private String facePath;

    public UserBean(String username, String pwd, String email, String facePath) {
        this.username = username;
        this.pwd = pwd;
        this.email = email;
        this.facePath = facePath;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "userId=" + userId +
                ", username='" + username + '\'' +
                ", pwd='" + pwd + '\'' +
                ", email='" + email + '\'' +
                ", time=" + time +
                ", facePath='" + facePath + '\'' +
                '}' + "\n";
    }
}
